<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<%
	String path = request.getContextPath();
%>
<title>化验检查-综合管理</title>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/css/btn_class.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/extjs/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/extjs/style.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/extjs/ext-patch.css" />

<script type="text/javascript"
	src="<%=path%>/extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="<%=path%>/extjs/ext-all.js"></script>
<script type="text/javascript" src="<%=path%>/js/datepicker/WdatePicker.js" defer="defer"></script>
<script type="text/javascript"	src="<%=path%>/mould_published/public.js"></script>
<script type="text/javascript" src="<%=path%>/extjs/RowExpander.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
	<div id="west-div" style="width: 100%; height: 100%;"></div>
	<div id="center-div"></div>
</body>
<script type="text/javascript">
	Ext.BLANK_IMAGE_URL = "<%=path%>/extjs/resources/images/default/s.gif";
				
	Ext.onReady(function() {
				Ext.QuickTips.init();
				
				var Jthtwb = Ext.data.Record.create([ {
					name : 'fid',
					mapping : 'fid',
					type : 'string'
				}, {
					name : 'fname',
					mapping : 'fname',
					type : 'string'
				}, {
					name : 'fdesc',
					mapping : 'fdesc',
					type : 'string'
				}, {
					name : 'fcdate',
					mapping : 'fcdate',
					type : 'string'
				} ]);

				var ds = new Ext.data.Store({
					reader : new Ext.data.JsonReader({
						totalProperty : 'totalProperty',
						root : 'root'
					}, Jthtwb),
					idProperty : 'threadid',
					remoteSort : true,
					url : 'role!queryRoleList.do'

				});

				

				var expander = new Ext.grid.RowExpander({
			        tpl : new Ext.Template(
			            '<p><b>Company:</b> {company}</p><br>',
			            '<p><b>Summary:</b> {desc}</p>'
			        )
			    });

				//定义列
				var colM = new Ext.grid.ColumnModel([ expander, 
				    {
						header : '检查日期',
						dataIndex : 'fname',
						width : 150,
						sortable : false
					}, {
						header : '检查项目',
						dataIndex : 'fdesc',
						width : 200,
						renderer : function(value) {
								if (value == "null") {
									return "";
								} else {
									return value;
								}
							}
					}, {
						header : '检查结果',
						dataIndex : 'fdesc',
						width : 200,
						renderer : function(value) {
								if (value == "null") {
									return "";
								} else {
									return value;
								}
							}
					}, {
						header : '参考值',
						dataIndex : 'fdesc',
						width : 200,
						renderer : function(value) {
								if (value == "null") {
									return "";
								} else {
									return value;
								}
							}
					}, {
						header : '开单医生',
						dataIndex : 'fdesc',
						width : 150,
						renderer : function(value) {
								if (value == "null") {
									return "";
								} else {
									return value;
								}
							}
					} ]);

				
				//生成表格
				var grid = new Ext.grid.GridPanel({
					closable : false,
					region : 'center',
					height : 350,
					autoWidth : true,
					stripeRows : true,
					//title : '检查患者列表',
					cm : colM,
					ds : ds,
					plugins: expander,
					listeners : {
						'rowdblclick' : function(grid, row) { //双击打开
							var record = grid.getSelectionModel().getSelected();
							if (record) {
								role_detail_form();
								Ext.get("role_name").dom.value = record.data.fname;
								Ext.get("role_desc").dom.value = record.data.fdesc;
								Ext.get("role_id").dom.value = record.data.fid;
							}
						}
					},
					bbar : new Ext.PagingToolbar({
				        pageSize: 50,
				        store: ds,
				        displayInfo: true,
				        displayMsg: '显示 {0} 到 {1} 条记录，共 {2} 条',
				        emptyMsg: "没有记录"
				    })
				});
				
				var b_date = new Ext.form.TextField({
					fieldLabel : '开始日期',
					format: 'yyyy-MM-dd',
					id:'fbdate_id',
					name:'fbdate',
					width : 90,
					style:"cursor:pointer;color:blue",
					listeners : {
						'focus' : function() {
							WdatePicker({startDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});
						}
					}
				});
			
	           var e_date = new Ext.form.TextField({
	   				fieldLabel : '结束日期',
	   				format: 'yyyy-MM-dd',
	   				id:'fedate_id',
					name:'fedate',
					width : 90,
					value : new Date().format('Y-m-d'),
	   				style:"cursor:pointer;color:blue",
	   				listeners : {
	   					'focus' : function() {
	   						WdatePicker({startDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true});
	   					}
	   				}
	   			});
	   			
	   			var btn_search_patient = new Ext.Button({
					text : '查询',
					iconCls : 'sy-search',
					handler : function(btn) {
						// show_chart();
					}
				});
				
				var zt_radio = new Ext.form.RadioGroup({
			                       id:'zt_radio_id',
								   style:'width:100px; display: block;text-align:left;line-height:22px;',
								   height:20,
								   width:200,
			       				   fieldLabel : '标记状态',
			                       columns : 3,
			                       vertical :true,
			                       items:[
			                              {boxLabel:'全部', inputValue:'0',name:'fstate',checked: true},
			                              {boxLabel:'已通知', inputValue:'1',name:'fstate'},
			                              {boxLabel:'未通知', inputValue:'2',name:'fstate'}
			                       ],
							       listeners : {
							        	'change' : function(rg, checked){
							        		//sqlContent.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
								   }}
						    });

			    var panel = new Ext.Panel({
			    	region: "center",
					layout:'fit',
					border : true,
					margins:'0 5 0 0',
					tbar : ['检查日期：',b_date, '至', e_date, '-', '关键字：', {
						xtype : 'textfield',
						fieldLabel : '关键字',
						id : 'fquery_id2',
						name : 'fquery',
						disabled : false,
						style:"cursor:pointer;color:blue",
						width : 120
					},'-', btn_search_patient ],
					items : [ grid]
				});
				
				var viewport = new Ext.Viewport({
					layout : 'border',
					items : [ panel ]
				});
				
				// Ext.getCmp('fquery_id2').focus(false, 300); //解决焦点无法获取问题 ， 使光标可以定位到选框
				
			});
</script>


</html>